package com.chinasoft.set01.map;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Demo03 {
    public static void main(String[] args) {

        Map<String,String> map = new HashMap<>();
        //put(K key, V value)
        map.put("k1","v1");
        map.put("k2","v2");
        map.put("k3","v3");
        map.put("k4","v4");
        map.put("k5","v5");
        // V  get(Object key)
        // System.out.println(map.get("k1"));
        // System.out.println(map.get("k2"));
        // Set<K> keySet()
        //method1(map);
        //Collection<V> values()
        Collection<String> values =  map.values();
        for (String v:values) {
            System.out.println("v = " + v);
        }

    }

    private static void method1(Map<String, String> map) {
        Set<String> keySet = map.keySet();
        for (String key:keySet){
            System.out.println(key+","+map.get(key));
        }
    }


}